<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Info/index')}">菜单列表</a></li>
        <li><a href="{:url('Info/add')}">添加菜单</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post">
        <input class="form-control" type="text" name="name" style="width: 200px;" value="{:input('request.name')}" placeholder="请输入名称关键字">
        <input class="js-bootstrap-datetime form-control" type="text" name="start" value="{:input('request.start')}" placeholder="选择起始日期">
        <input class="js-bootstrap-datetime form-control" type="text" name="end" value="{:input('request.end')}" placeholder="选择结束日期">
        <select name="status" class="form-control" style="width: 80px">
            <option value="">全部</option>
            <option value="1" <eq name=":input('request.status')" value="1"> selected </eq>>显示</option>
            <option value="0" <eq name=":input('request.status')" value="0"> selected </eq>>隐藏</option>
        </select>
        <input type="submit" class="btn btn-primary" value="{:lang('Search')}"/>
        <a class="btn btn-danger" href="{:url('Info/index')}">{:lang('Clear')}</a>
    </form>
    <form class="js-ajax-form" action="{:url('Info/listOrder')}" method="post">
        <div class="table-actions">
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
        </div>
        <table class="table table-hover table-bordered table-list" id="menus-table">
            <thead>
            <tr>
                <th width="80">{:lang('SORT')}</th>
                <th width="50">ID</th>
                <th>{:lang('NAME')}</th>
                <th>{:lang('DETAILS')}</th>
                <th>创建时间</th>
                <th>更新时间</th>
                <th width="80">{:lang('STATUS')}</th>
                <th width="180">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="info" item="vo">
                <tr>
                    <td style="padding-left:20px;">
                        <input name="list_orders[{$vo.id}]" type="text" size="3" value="{$vo.list_order}" class="input input-order">
                    </td>
                    <td>{$vo.id}</td>
                    <td>{$vo.name}</td>
                    <td>{$vo.details}</td>
                    <td>{$vo.create_time}</td>
                    <td>{$vo.update_time}</td>
                    <td>
                        <empty name="vo.status">
                            <a class="label label-warning js-ajax-dialog-btn"
                               data-msg="确定改为显示状态吗？"
                               href="{:url('Info/changeStatus', ['id' =>$vo.id])}"
                               style="text-decoration: none">{:lang('HIDDEN')}</a>
                            <else/>
                            <a class="label label-success js-ajax-dialog-btn"
                               data-msg="确定改为隐藏状态吗？"
                               href="{:url('Info/changeStatus', ['id' =>$vo.id])}"
                               style="text-decoration: none">{:lang('DISPLAY')}</a>
                        </empty>
                    </td>
                    <td>
                        <a class="btn btn-xs btn-success"
                           href="{:url('Info/edit', ['id' =>$vo.id])}">{:lang('EDIT')}</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete"
                           href="{:url('Info/deleteSoft', ['id' =>$vo.id])}">{:lang('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="table-actions">
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
        </div>
    </form>
</div>
<div style="text-align: center">
    <div class="pagination">{$info->render()}</div>
</div>
<script src="__STATIC__/js/admin.js?v={$_static_version}"></script>
<script>
    $(document).ready(function () {
        Wind.css('treeTable');
        Wind.use('treeTable', function () {
            $("#menus-table").treeTable({
                indent: 20
            });
        });
    });
</script>
</body>
</html>
